#include "threadpool.h"
#include <chrono>

class MyTask :public Task
{
public:
	void run()
	{
		std::cout << "thread begin" << std::endl;
		std::cout << "tid:" << std::this_thread::get_id() << std::endl;
		std::cout << "thread end" << std::endl;
	}
};
int main()
{
	ThreadPool pool;
	pool.start(8);

	pool.submitTask(std::make_shared<MyTask>());
	pool.submitTask(std::make_shared<MyTask>());
	pool.submitTask(std::make_shared<MyTask>());
	pool.submitTask(std::make_shared<MyTask>());

	getchar();
//	std::this_thread::sleep_for(std::chrono::seconds(5));
	return 0;
}